package team.kirohuji.domain.attendance;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import team.kirohuji.domain.user.User;

@Entity
@Table(name = "particular_attendance")
public class ParticularAttendance {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="particular_attendance_id")
	private Integer ParticularAttendanceId;
	@Column(name="check_date")
	private Date checkDate;

	private Integer type;

	private boolean approve;
	@Column(name="create_date")
	private Date createDate;
	@Column(name="end_date")
	private Date endDate;

	private String reason;

	private String comment;

	@OneToOne(cascade = CascadeType.REFRESH)
	@JoinColumn(name = "user_id")
	private User user;

	public Integer getParticularAttendanceId() {
		return ParticularAttendanceId;
	}

	public void setParticularAttendanceId(Integer particularAttendanceId) {
		ParticularAttendanceId = particularAttendanceId;
	}

	public Date getCheckDate() {
		return checkDate;
	}

	public void setCheckDate(Date checkDate) {
		this.checkDate = checkDate;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public boolean isApprove() {
		return approve;
	}

	public void setApprove(boolean approve) {
		this.approve = approve;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Override
	public String toString() {
		return "ParticularAttendance [ParticularAttendanceId=" + ParticularAttendanceId + ", checkDate=" + checkDate
				+ ", type=" + type + ", approve=" + approve + ", createDate=" + createDate + ", endDate=" + endDate
				+ ", reason=" + reason + ", comment=" + comment + ", user=" + user + "]";
	}

}
